#coding=utf-8

import hashlib
from settings import DEFAULT_AUTH_SALT

class AuthPassword:
  def __init__(self, password):
      self.password = self._gen_pwd(password)

  @staticmethod
  def _gen_pwd(password):
      m = hashlib.sha1()
      m.update(password + DEFAULT_AUTH_SALT)
      return m.hexdigest()

  def verify(self, password):
        return self.password == password

